/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package slsBeans;

import EL.Account;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author MinhHang
 */
@Stateless
public class AccountBLO implements AccountBLORemote {

    @PersistenceContext(unitName = "ejp3-data-eproPU")
    private EntityManager em;

    public Account checkLoginAcc(String username, String password) {
        String hql = "From tbl_Account as c.where c.username = '" + username + "' and c.password ='" + password + "' ";
        Query query = this.em.createQuery(hql);
        Account acc = (Account) query.getSingleResult();
        return acc;
    }
}
